// 组件
import {
  Button,
  ConfigProvider,
  Result,
  Empty,
  Menu,
  Tabs,
  Form,
  Input,
  Dropdown,
  Image,
  Card,
  Table,
  Modal,
  Tag,
  Radio,
  Select
} from 'ant-design-vue'
// 图标
import {
  UserOutlined,
  VideoCameraOutlined,
  UploadOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  SearchOutlined,
  CloseCircleOutlined,
  DownOutlined,
  SettingOutlined
} from '@ant-design/icons-vue'
const components = [
  Button,
  ConfigProvider,
  Result,
  Empty,
  Menu,
  Tabs,
  Form,
  Input,
  Dropdown,
  Image,
  Card,
  Table,
  Modal,
  Tag,
  Radio,
  Select
]

const icons: any = {
  UserOutlined,
  DownOutlined,
  VideoCameraOutlined,
  UploadOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  SearchOutlined,
  CloseCircleOutlined,
  SettingOutlined
}
const labelCol = {
  sm: {
    span: 12
  },
  md: {
    span: 12
  },
  xl: {
    span: 8
  },
  xxl: {
    span: 6
  }
}
const wrapperCol = {
  sm: {
    span: 8
  },
  md: {
    span: 8
  },
  xl: {
    span: 14
  },
  xxl: {
    span: 12
  }
}

export default (app:any) => {
  components.forEach((item) => {
    app.use(item)
  })
  for (const key in icons) {
    app.component(key, icons[key])
  }
  app.config.globalProperties.$wrapperCol = wrapperCol
  app.config.globalProperties.$labelCol = labelCol
}
